import * as THREE from 'three';

/**
 * 模型工厂
 */
let geometry = {
    //长方体 参数：长，宽，高
    box: new THREE.BoxGeometry(10, 10, 10),
    // 球体 参数：半径60  经纬度细分数40,40
    sphere: new THREE.SphereGeometry(10, 10, 10),
    // 圆柱  参数：圆柱面顶部、底部直径50,50   高度100  圆周分段数
    cylinder: new THREE.CylinderGeometry(10, 10, 10, 10),
    // 正八面体
    octahedron: new THREE.OctahedronGeometry(10),
    // 正十二面体
    dodecahedron: new THREE.DodecahedronGeometry(10),
    // 正二十面体
    icosahedron: new THREE.IcosahedronGeometry(10),
    getByIndex: (index) => {
        return geometry[Object.keys(geometry)[index]]
    }
}

export default geometry;